package com.slipper.core.database.vo;

import com.slipper.constants.Constants;

public class FieldVO {
    /** 字段名 */
    private String name;
    /** 字段类型 */
    private String type;
    /** 字段长度 */
    private Long length;
    /** 字段精度 */
    private Integer precision;
    /** 是否主键 */
    private String primaryKey;
    /** 是否可空 */
    private String nullable;
    /** 排序 */
    private int ordinal;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getLength() {
        return length;
    }

    public void setLength(Long length) {
        this.length = length;
    }

    public Integer getPrecision() {
        return precision;
    }

    public void setPrecision(Integer precision) {
        this.precision = precision;
    }

    public boolean isPrimaryKey() {
        return Constants.YES.equals(primaryKey);
    }

    public String getPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(String primaryKey) {
        this.primaryKey = primaryKey;
    }

    public boolean isNullable() {
        return Constants.YES.equals(nullable) ;
    }

    public String getNullable() {
        return nullable;
    }

    public void setNullable(String nullable) {
        this.nullable = nullable;
    }

    public int getOrdinal() {
        return ordinal;
    }

    public void setOrdinal(int ordinal) {
        this.ordinal = ordinal;
    }
}
